<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:fragment="head">
        <link href="../../static/images/me.jpg" th:href="@{/images/me.jpg}" rel="icon" type="image/x-ico">
        <link rel="stylesheet" th:href="@{/css/semantic.min.css}">
        <link rel="stylesheet" href="../../static/css/me.css" th:href="@{/css/me.css}">
    </th:block>

</head>
<body>
<!--公共导航栏-->
<nav th:fragment="menu(n)" class="ui inverted gird-header" >
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui olive header item" style="font-family: STSong">管理后台</h2>
            <a href="#" th:href="@{/admin/blog}" class="m-item item m-mobile-hide" th:classappend="${n==1} ? 'active'"><i class="home icon"></i>文章管理</a>
            <a href="#" th:href="@{/admin/types}" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i class="clone outline icon"></i>分类管理</a>
            <a href="#" th:href="@{/admin/friend}" class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'"><i class="pencil alternate icon"></i>友链管理</a>
            <a href="#" th:href="@{/admin/picture}" class=" m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'"><i class="image icon"></i>相册管理</a>
            <div class="right m-item m-mobile-hide menu">
                <div class="ui dropdown  item">
                    <div class="text">
                        <img class="ui avatar image" src="../../static/images/me.jpg" th:src="@{/images/me.jpg}">
                        <span th:text="${session.user.username}">青柠</span>
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" th:href="@{/admin/logout}" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>
</div>

<!--公共底部-->
<div id="footer">
    <footer class="ui inverted vertical segment m-padded-tb-massive m-opacity">
        <!--容器-->
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid">
                <div class="four wide column">
                    <div style="font-size: large;font-weight: bold" class="ui inverted m-text-thin m-text-spaced m-margin-top-max" ></div>
                    <div class="ui inverted link list">
                    </div>
                </div>

                <div class="four wide column" >
                    <div class="ui inverted link list">
                        <div class="item">

                        </div>
                    </div>
                </div>

                <div class="four wide column" >
                    <div class="ui inverted link list">
                        <div class="item">

                        </div>
                    </div>
                </div>

                <!--博客运行时间统计-->
                <div class="four wide column">

                    <!--<p id="htmer_time" class="item m-text-thin"></p>-->
                    <div id="blog-message">
                        <div class="ui inverted link list" style="align-content: center;margin-top: 10px">

                        </div>
                    </div>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <div style="color: #F08047;margin-top: -18px" class="ui inverted m-text-thin m-text-spaced">我的客栈已营业：<span id="sitetime" class="item m-text-thin"></span> (*๓´╰╯`๓)</div>
            <a rel="nofollow" target="_blank">备案号:辽ICP备2020013405号-2</a>
        </div>
</div>
</footer>
</div>


<!--公共js-->
<div id="js">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

    <script>
        // 运行时间统计
        function siteTime(){
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /* Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year - 作为date对象的年份，为4位年份值
            month - 0-11之间的整数，做为date对象的月份
            day - 1-31之间的整数，做为date对象的天数
            hours - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes - 0-59之间的整数，做为date对象的分钟数
            seconds - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数 */
            var t1 = Date.UTC(2021,2,01,23,46,00); //北京时间2016-12-1 00:00:00
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML=" 已运行"+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>
</div>
</body>
</html>